package day04;

import java.sql.Array;

public class FindArrIndex {
    public static void main(String[] args) {
        int[] brr={1,2,3};
        System.out.println(brr);
       int[] res= TwoSum(brr,4);
        System.out.println(res.toString());
    }

    public static int[] TwoSum(int[] sums,int target){
        int[] arr =new int[2];
        for (int i = 0; i <sums.length ; i++) {
            for(int j=i;j<sums.length;j++){
                if(target-sums[i]==sums[j]){
                    arr[0]=i;
                    arr[1]=j;
                }
            }
        }
        return arr;
    }
}
